package org.android;

import android.location.Address;

public class HelloRoadAddress extends Address {
	private String featureName;
	private String postalCode;
	private String locality;
	private String countryName;
	private String countryCode;
	private double latitude;
	private double longitude;
	
	public HelloRoadAddress(Address address) {
		super(address.getLocale());
		this.featureName = address.getFeatureName();
		this.postalCode = address.getPostalCode();
		this.locality = address.getLocality();
		this.countryName = address.getCountryName();
		this.countryCode = address.getCountryCode();
		this.latitude = address.getLatitude();
		this.longitude = address.getLongitude();
	}

	/**
	 * @param featureName the featureName to set
	 */
	public void setFeatureName(String featureName) {
		this.featureName = featureName;
	}

	/**
	 * @return the featureName
	 */
	public String getFeatureName() {
		return featureName;
	}

	/**
	 * @param postalCode the postalCode to set
	 */
	public void setPostalCode(String postalCode) {
		this.postalCode = postalCode;
	}

	/**
	 * @return the postalCode
	 */
	public String getPostalCode() {
		return postalCode;
	}

	/**
	 * @param locality the locality to set
	 */
	public void setLocality(String locality) {
		this.locality = locality;
	}

	/**
	 * @return the locality
	 */
	public String getLocality() {
		return locality;
	}

	/**
	 * @param countryName the countryName to set
	 */
	public void setCountryName(String countryName) {
		this.countryName = countryName;
	}

	/**
	 * @return the countryName
	 */
	public String getCountryName() {
		return countryName;
	}

	/**
	 * @param countryCode the countryCode to set
	 */
	public void setCountryCode(String countryCode) {
		this.countryCode = countryCode;
	}

	/**
	 * @return the countryCode
	 */
	public String getCountryCode() {
		return countryCode;
	}

	/**
	 * @param latitude the latitude to set
	 */
	public void setLatitude(double latitude) {
		this.latitude = latitude;
	}

	/**
	 * @return the latitude
	 */
	public double getLatitude() {
		return latitude;
	}

	/**
	 * @param longitude the longitude to set
	 */
	public void setLongitude(double longitude) {
		this.longitude = longitude;
	}

	/**
	 * @return the longitude
	 */
	public double getLongitude() {
		return longitude;
	}

	@Override
	public String toString() {
		StringBuilder str = new StringBuilder();
		if (featureName != null)
			str.append(featureName + " ");
		if (postalCode != null)
			str.append(postalCode + " ");
		if (locality != null)
			str.append(locality + " ");
		if (countryName != null)
			str.append(countryName + ", ");
		if (countryCode != null)
			str.append(countryCode + " ");
		return str.toString();
	}

}